***** Replication code for Franchino, Fabio, and Camilla Mariotto. “Noncompliance Risk, Asymmetric Power and the Design of Enforcement of the European Economic Governance”. European Union Politics.

***** Online Appendix Section 3.2 Re-categorization of issues test
* Preparation stage 2  (you can skip this stage)
*  These harder-to-converge models need to be estimated separately
clear
version 15
pause on
use conflict_data_FC2.dta, clear

* Coding primary and secondary dimensions
gen dim_d_nat=1 if discr_nat!=.
gen dim_d_cou=1 if discr_cou!=.
gen dim_d_com=1 if discr_com!=.
label variable dim_d_nat "Primary (1) or secondary (2) dimension"
label variable dim_d_cou "Primary (1) or secondary (2) dimension"
label variable dim_d_com "Primary (1) or secondary (2) dimension"
label define dimension 1 "primary" 2 "secondary"
label values dim_d_nat dimension
label values dim_d_cou dimension
label values dim_d_com dimension
order discr_nat dim_d_nat, after(tighten)
order discr_cou dim_d_cou, after(constr_cou)
order discr_com dim_d_com, after(constr_com)

* Issue 3 - added National Discretion 
replace dim_d_nat=2 if issue_id==3
replace discr_nat=discr_cou if issue_id==3
* list country discr_nat dim_d_nat discr_cou dim_d_cou if issue_id==3
* Generalized structural equation model: Three-levels, Random intercepts
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) iterate(100) intmethod(mcaghermite) intpoints(6)

matrix b1=e(b)		
matrix list b1	
matrix b = b1
clear
svmat b
append using robtest_iss_FC.dta
save robtest_iss_FC.dta, replace

** Next issue
clear
version 15
pause on
use conflict_data_FC2.dta, clear

* Code dimensions
gen dim_d_nat=1 if discr_nat!=.
gen dim_d_cou=1 if discr_cou!=.
gen dim_d_com=1 if discr_com!=.
label variable dim_d_nat "Primary (1) or secondary (2) dimension"
label variable dim_d_cou "Primary (1) or secondary (2) dimension"
label variable dim_d_com "Primary (1) or secondary (2) dimension"
label define dimension 1 "primary" 2 "secondary"
label values dim_d_nat dimension
label values dim_d_cou dimension
label values dim_d_com dimension
order discr_nat dim_d_nat, after(tighten)
order discr_cou dim_d_cou, after(constr_cou)
order discr_com dim_d_com, after(constr_com)

* Issue 8 - added Council Discretion (switched)
replace dim_d_cou=2 if issue_id==8
replace discr_cou=discr_com if issue_id==8
recode discr_cou (1 = 3) (3 = 1) if issue_id==8
* list country discr_cou dim_d_cou discr_com dim_d_com if issue_id==8
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) iterate(100) intmethod(ghermite) intpoints(4)
matrix d = e(d)
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) iterate(100) intmethod(mcaghermite) intpoints(4) from(d, skip)

matrix b1=e(b)		
matrix list b1	
matrix b = b1
clear
svmat b
append using robtest_iss_FC.dta
save robtest_iss_FC.dta, replace

** Next issue
clear
version 15
pause on
use conflict_data_FC2.dta, clear

* Code dimensions
gen dim_d_nat=1 if discr_nat!=.
gen dim_d_cou=1 if discr_cou!=.
gen dim_d_com=1 if discr_com!=.
label variable dim_d_nat "Primary (1) or secondary (2) dimension"
label variable dim_d_cou "Primary (1) or secondary (2) dimension"
label variable dim_d_com "Primary (1) or secondary (2) dimension"
label define dimension 1 "primary" 2 "secondary"
label values dim_d_nat dimension
label values dim_d_cou dimension
label values dim_d_com dimension
order discr_nat dim_d_nat, after(tighten)
order discr_cou dim_d_cou, after(constr_cou)
order discr_com dim_d_com, after(constr_com)
	 
* Issue 13 - added Council Discretion (switched)
replace dim_d_cou=2 if issue_id==13
replace discr_cou=discr_com if issue_id==13
recode discr_cou (1 = 3) (3 = 1) if issue_id==13
* list country discr_cou dim_d_cou discr_com dim_d_com if issue_id==13
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 i.comm_s M1[act] M2[act>issue_id], ologit ), vce(robust) iterate(100) intmethod(ghermite) intpoints(3)

matrix b1=e(b)		
matrix list b1	
matrix b = b1
clear
svmat b
append using robtest_iss_FC.dta
save robtest_iss_FC.dta, replace

